<%@ page import="java.sql.Connection" %>
<%@ page import="com.edu.util.MyBatisUtil" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
		 pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>易买网 - 首页</title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css" />
<%--<link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/function.js"></script>
<%
	String ctx=request.getContextPath();
%>
</head>
<script>
	$(function () {
		$("ul.pagination li.disabled a").click(function () {
			return false
		});
	});
</script>
<body>
<div id="welcomeImage">
    <img width="100%" height="150" src="${pageContext.request.contextPath}/static/images/banner.jpg" alt="welcome">
</div>
<jsp:include page="top.jsp" />
<div id="main" class="wrap">
	<jsp:include page="leftbar.jsp" />
	<div class="main">
		<div class="price-off">
            <div class="slideBox">
                <ul id="slideBox">
                    <li><img src="${pageContext.request.contextPath}/static/images/product/banner_1.jpg"/></li>
                    <li><img src="${pageContext.request.contextPath}/static/images/product/banner_2.jpg"/></li>
                    <li><img src="${pageContext.request.contextPath}/static/images/product/banner_3.jpg"/></li>
                    <li><img src="${pageContext.request.contextPath}/static/images/product/banner_4.jpg"/></li>
                </ul>
            </div>
			<h2>商品列表</h2>
			<ul class="product clearfix">
<%--			<ul>--%>
				<c:if test="${productList == null || productList.size()==0}">
					无任何商品！
				</c:if>
				<c:forEach items="${productList}" var="product">
					<li>
						<dl>
							<dt><a href="<%=ctx%>/product/productView?entityId=${product.epId}" target="_self"><img alt="" src="${pageContext.request.contextPath}/static/files/${product.epFileName}"/></a></dt>
							<dd class="title"><a>${product.epName}</a> </dd>
							<dd class="price">${product.epPrice}</dd>
						</dl>
					</li>
				</c:forEach>
			</ul>
			<nav class="pager">
				<ul class="pagination">
					<li><a href="<%=ctx%>/home/index?start=0"><span>首页</span></a></li>
					<li <c:if test="${!page.hasPre}"> class="disabled"</c:if>><a href="<%=ctx%>/home/index?start=${page.start-page.pageSize}"><span>上一页</span></a></li>
					<li <c:if test="${!page.hasNext}"> class="disabled"</c:if>><a href="<%=ctx%>/home/index?start=${page.start+page.pageSize}"><span>下一页</span></a></li>
					<li><a href="<%=ctx%>/home/index?start=${page.last}"><span>尾页</span></a></li>
				</ul>
			</nav>
		</div>
		<div class="side">
			<div class="news-list">
				<h4>新闻动态</h4>
				<ul>
					<c:if test="${newsList==null || newsList.size()==0}">
						无任何新闻！
					</c:if>
					<c:forEach items="${newsList}" var="news">
					<li>
						<dl>
							<dt><a>${news.enTitle}</a></dt>
						</dl>
					</li>
					</c:forEach>
				</ul>
			</div>
		</div>
		<div class="spacer clear"></div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2020 XXX All Rights Reserved. 京ICP证1000001号
</div>
</body>
</html>